<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>地图事件</title>
    <style type="text/css">
        body{
            margin: 0;
            overflow: hidden;
            background: #fff;
        }
        #map{
            position: relative;
            height: 553px;
            border:1px solid #3473b7;
        }

    </style>
    <link href='./css/bootstrap.min.css' rel='stylesheet' />
    <link href='./css/bootstrap-responsive.min.css' rel='stylesheet' />
    <script src='../libs/SuperMap.Include.js'></script>
    <script type="text/javascript">
        var map,layer,
                host = document.location.toString().match(/file:\/\//)?"http://localhost:8090":'http://' + document.location.host,
                url=host+"/iserver/services/map-world/rest/maps/World";
        function init()
        {
            map = new SuperMap.Map("map",{controls:[
            new SuperMap.Control.Zoom()]});
            layer = new SuperMap.Layer.TiledDynamicRESTLayer("World", url, {transparent: true, cacheEnabled: true},{maxResolution:"auto"});
            layer.events.on({"layerInitialized":addLayer});
            map.events.on({"click":callbackFunction});  //添加click事件

        }
        function addLayer()
        {
            map.addLayer(layer);
            map.setCenter(new SuperMap.LonLat(0,0), 0);
        }
        function callbackFunction(e)
        {
          alert("鼠标事件");

        }
    </script>
</head>
<body onload="init()">
<div id="map"></div>
</body>
</html>